<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-09-06 00:34:26
 * @LastEditTime: 2019-11-29 20:45:33
 * @LastEditors: Please set LastEditors
 -->
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../css/vant.css">
    <link rel="stylesheet" type="text/css" href="../css/base.css" />
    <script type="text/javascript" src="../script/jquery.js"></script>
    <script type="text/javascript" src="../script/echarts.js"></script>
    <script type="text/javascript" src="../script/layer/mobile/layer.js"></script>
    <script type="text/javascript" src="../script/vue.min.js"></script>
    <script type="text/javascript" src="../script/vant.min.js"></script>
    <script type="text/javascript" src="../script/fastclick.js"></script>
    <script type="text/javascript" src="../script/base.js"></script>
    <style type="text/css">
        .tab {
            padding: 15px;
            overflow: hidden;
        }

        .tab .t-d {
            float: right;
            font-size: 0;
            border-radius: 6px;
        }

        .tab .t-d>div {
            display: inline-block;
            width: 60px;
            text-align: center;
            height: 24px;
            font-size: 13px;
            border: 1px solid #cd1b21;
            line-height: 22px;
        }

        .tab .t-d>div.on {
            background: #cd1b21;
            color: #fff;
            line-height: 22px;
        }



        .no-b {
            border-left: 0 !important;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div class="init-full">
            <van-nav-bar class="head" title="数据汇总" left-arrow @click-left="onClickLeft">
                <div slot="right" class="head-right" v-if="tabActive != 2">
                    <span @click="showFrameSearch">
                        <img src="../image/search.png" />
                    </span>
                </div>
            </van-nav-bar>
            <div class="body-no-bottom">
                <div class="content">

                    <div class="tab">
                        <div class="t-d">
                            <div :class="tabActive == 1?'on':''" @click="toggleActive(1)">经营</div>
                            <div class="no-b" :class="tabActive == 2?'on':''" @click="toggleActive(2)">收益</div>
                        </div>
                    </div>



                </div>
                <van-loading v-if="showLoading" />
            </div>
        </div>


    </div>
</body>

<script type="text/javascript">
    var vm;
    apiready = function () {
        //$('.init-full').show();
        var userInfo = FLD.getUserInfo();

        vm = new Vue({
            el: '#app',
            data: {
                showLoading: false,
                showSearch: false,
                tabActive: 1
            },
            created: function () {
                var that = this;
                that.toggleActive(1);
            },
            methods: {

                showFrameSearch() {
                    api.sendEvent({
                        name: 'toggleFrameSearch',
                        extra: {
                            frameName: '首页层次统计_0'
                        }
                    });
                },
                toggleActive(index) {
                    var that = this;
                    that.tabActive = index;
                    var appTop_ = parseInt(window.localStorage.getItem('safeAreaTop'));
                    var y = appTop_ ? (appTop_ + 94) : (appTop_ + 79);
                    if (that.tabActive == 1) {
                        api.openFrame({
                            name: '首页层次统计_0',
                            url: 'common/formConfigReport.html',
                            rect: {
                                x: 0,
                                y: y,
                                w: api.winWidth,
                                h: api.winHeight - y
                            },
                            pageParam: {
                                objName: '首页层次统计',
                                isFrame: true
                            }
                        });
                        api.sendEvent({
                            name: 'toggleFrameSearch',
                            extra: {
                                frameName: '首页层次统计_0',
                                frameSearch:false
                            }
                        });
                    } else if (that.tabActive == 2) {
                        api.openFrame({
                            name: '人员收支查询_0',
                            url: 'common/formConfigReport.html',
                            rect: {
                                x: 0,
                                y: y,
                                w: api.winWidth,
                                h: api.winHeight - y
                            },
                            pageParam: {
                                objName: '人员收支查询',
                                isFrame: true
                            }
                        });
                    }
                },
                onClickLeft() {
                    api.closeWin();
                }
            }
        })
    };
</script>

</html>